<head>
    <title><span key="userProfile.title"/></title>
    <content tag="heading"><span key="userProfile.heading"/></content>
    <meta name="menu" content="UserMenu"/>
</head>

<body jwcid="@Body">

<span jwcid="@ShowValidationError" delegate="ognl:beans.delegate"/>
<span jwcid="@ShowMessage"/>

<div class="separator"></div>

<form jwcid="userForm">
<input jwcid="from@Hidden" type="hidden" id="from" value="ognl:from"/>
<input jwcid="id@Hidden" type="hidden" value="ognl:user.id"/>
<input jwcid="version@Hidden" type="hidden" value="ognl:user.version"/>
<input jwcid="originalPassword@Hidden" type="hidden" value="ognl:user.password"/>

<div jwcid="@If" condition="ognl:request.session.getAttribute('cookieLogin') == 'true'">
    <input jwcid="@Hidden" id="password" value="ognl:user.password"/>
    <input jwcid="@Hidden" id="confirmPassword" value="ognl:user.confirmPassword"/>
</div>

<span jwcid="@If" condition="ognl:user.username == null">
    <input type="hidden" name="encryptPass" value="true" />
</span>

<ul>
    <li class="buttonBar right">
        <input type="submit" class="button" jwcid="@Submit" value="message:button.save" action="listener:save"/>
          <span jwcid="@If" condition="ognl:user.username != null">
            <input type="submit" class="button" jwcid="@Submit" value="message:button.delete" action="listener:delete"
                onclick="form.onsubmit = null; return confirmDelete('User')"/>
          </span>
        <input type="submit" class="button" jwcid="@Submit" value="message:button.cancel" action="listener:cancel"
            onclick="form.onsubmit = null"/>
    </li>
    <li class="info">
        <div jwcid="@If" condition="ognl:from == 'list'"><span key="userProfile.admin.message">message for admins</span></div>
        <div jwcid="@If" condition="ognl:from != 'list'"><span key="userProfile.message">instructional message</span></div>
    </li>
    <li>
        <label class="desc" jwcid="@FieldLabel" field="ognl:components.usernameField">Username</label>
        <input jwcid="usernameField" type="text" id="username" class="text large"/>
    </li>
    <div jwcid="@If" condition="ognl:requestCycle.requestContext.session.getAttribute('cookieLogin') != 'true'">
    <li>
        <div>
            <div class="left">
                <label class="desc" jwcid="@FieldLabel" field="ognl:components.passwordField">Password</label>
                <input class="text medium" jwcid="passwordField" type="password" id="password"/>
            </div>
            <div>
                <label class="desc" jwcid="@FieldLabel" field="ognl:components.confirmPasswordField">Confirm Password</label>
                <input class="text medium" jwcid="confirmPasswordField" type="password" id="confirmPassword"/>
            </div>
        </div>
    </li>
    </div>
    <li>
        <label class="desc" jwcid="@FieldLabel" field="ognl:components.passwordHintField">Password Hint</label>
        <input class="text large" jwcid="passwordHintField" type="text" id="passwordHint"/>
    </li>
    <li>
        <div>
            <div class="left">
                <label class="desc" jwcid="@FieldLabel" field="ognl:components.firstNameField">First Name</label>
                <input class="text medium" jwcid="firstNameField" type="text" id="firstName"/>
            </div>
            <div>
                <label class="desc" jwcid="@FieldLabel" field="ognl:components.lastNameField">Last Name</label>
                <input class="text medium" jwcid="lastNameField" type="text" id="lastName"/>
            </div>
        </div>
    </li>
    <li>
        <div>
            <div class="left">
                <label class="desc" jwcid="@FieldLabel" field="ognl:components.emailField">E-Mail</label>
                <input class="text medium" jwcid="emailField" type="text" id="email"/>
            </div>
            <div>
                <label class="desc" jwcid="@Label" for="phoneNumber" key="user.phoneNumber">Phone Number</label>
                <input class="text medium" jwcid="phoneNumberField" type="text" id="phoneNumber"/>
            </div>
        </div>
    </li>
    <li>
        <label class="desc" jwcid="@FieldLabel" field="ognl:components.websiteField">Website</label>
        <input class="text large" jwcid="websiteField" type="text" id="website"/>
    </li>
    <li>
        <label class="desc"><span key="user.address.address"/></label>
        <div class="group">
            <div>
                <input class="text large" jwcid="addressField" type="text" id="address"/>
                <p><label jwcid="@Label" for="address" key="user.address.address">Address</label></p>
            </div>
            <div class="left">
                <input class="text medium" jwcid="cityField" type="text" id="city"/>
                <p><label jwcid="@FieldLabel" field="ognl:components.cityField" prerender="false">City</label></p>
            </div>
            <div>
                <input class="text state" jwcid="stateField" type="text" id="state" size="2"/>
                <p><label jwcid="@FieldLabel" field="ognl:components.stateField" prerender="false">State</label></p>
            </div>
            <div class="left">
                <input class="text zip" jwcid="postalCodeField" type="text" id="zip"/>
                <p><label jwcid="@FieldLabel" field="ognl:components.postalCodeField" prerender="false">Zip</label></p>
            </div>
            <div>
                <select jwcid="countryField" size="1" class="select">
                    <option></option>
                </select>
                <p><span key="user.address.country"/> <label><span class="req">*</span></label></p>
            </div>
        </div>
    </li>
    <div jwcid="@If" condition="ognl:from == 'list'">
    <li>
        <fieldset>
            <legend><span key="userProfile.accountSettings"/></legend>
            <label>
                <input class="checkbox" type="checkbox" jwcid="@Checkbox" value="ognl:user.enabled" id="enabled"/>
                <label jwcid="@Label" class="choice" for="enabled" key="user.enabled"/>
            </label>
            <label>
                <input class="checkbox" type="checkbox" jwcid="@Checkbox" value="ognl:user.accountExpired" id="accountExpired"/>
                <label jwcid="@Label" class="choice" for="accountExpired" key="user.accountExpired"/>
            </label>
            <label>
                <input class="checkbox" type="checkbox" jwcid="@Checkbox" value="ognl:user.accountLocked" id="accountLocked"/>
                <label jwcid="@Label" class="choice" for="accountLocked" key="user.accountLocked"/>
            </label>
            <label>
                <input class="checkbox" type="checkbox" jwcid="@Checkbox" value="ognl:user.credentialsExpired" id="credentialsExpired"/>
                <label jwcid="@Label" class="choice" for="credentialsExpired" key="user.credentialsExpired"/>
            </label>
        </fieldset>
    </li>
    <li>
        <fieldset>
            <legend><span key="userProfile.assignRoles"/></legend>
            <input class="checkbox" type="checkbox" jwcid="userRoles"/>
        </fieldset>
    </li>
    </div>
    <div jwcid="@If" condition="ognl:from != 'list'">
    <li>
        <strong><span key="user.roles"/>:</strong>
        <input jwcid="hiddenUserRoles" type="hidden"/>
        <input jwcid="@Hidden" type="hidden" value="ognl:user.enabled"/>
        <input jwcid="@Hidden" type="hidden" value="ognl:user.accountExpired"/>
        <input jwcid="@Hidden" type="hidden" value="ognl:user.accountLocked"/>
        <input jwcid="@Hidden" type="hidden" value="ognl:user.credentialsExpired"/>
    </li>
    </div>
    <li class="buttonBar bottom">
        <input type="submit" class="button" jwcid="@Submit" value="message:button.save" action="listener:save"/>
        <span jwcid="@If" condition="ognl:user.username != null">
        <input type="submit" class="button" jwcid="@Submit" value="message:button.delete" action="listener:delete"
            onclick="form.onsubmit = null; return confirmDelete('User')"/>
        </span>
        <input type="submit" class="button" jwcid="@Submit" value="message:button.cancel" action="listener:cancel"
            onclick="form.onsubmit = null"/>
    </li>
</ul>
</form>

<script type="text/javascript">
    Form.focusFirstElement($("userForm"));
    highlightFormElements();
</script>
</body>
